#ifndef __OHOS_PLAYER_H__
#define __OHOS_PLAYER_H__

#include <string>

class OHPlayer {
public:
    void init(const std::string &url);

    ~OHPlayer();

    bool IsRender() const;

    // 解封装
    void ReadSampleBuffer(struct OH_AVBuffer *buffer);

private:
    void initCoder(void *nativeWindow);

    bool isRender{true};
    uint32_t audioTrackIndex{0};
    uint32_t videoTrackIndex{0};
    int32_t frameWidth{0};
    int32_t frameHeight{0};
    bool videoIsEnd{false};
    bool audioIsEnd{false};

    struct OH_AVSource *ohSource{nullptr};
    struct OH_AVDemuxer *ohDemuxer{nullptr};
    struct OH_AVCodec *ohCodec{nullptr};
};


#endif // __OHOS_PLAYER_H__